package com.pcbly.web.action.system;

import java.util.List;

import com.pcbly.web.action.BaseAction;
import com.pcbly.web.bean.system.CompanyInforBean;
import com.pcbly.web.business.system.CompanyInforService;

public class CompanyInforAction extends BaseAction<CompanyInforBean> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6107138866091756869L;
	
	private CompanyInforService companyInforService;
	private CompanyInforBean companyInforBean;
	private List<CompanyInforBean> companyInforBeans;
	

	public String save()throws Exception{
		if(log.isDebugEnabled()){
			log.debug("save login......");
		}
		if(companyInforBean.getId()==null){
			companyInforBean=companyInforService.saveCompanyInforBean(companyInforBean);
			addActionMessage(getText("entity.saved"));
		}else{
			companyInforBean=companyInforService.updateCompanyInforBean(companyInforBean);
			addActionMessage(getText("entity.updated"));
		}
		return super.save();
	}
	public String index()throws Exception{
		super.setId("4028ffbc25001d350125001da3cb0001");
		if(!(getId()==null||"".equals(getId().trim()))){
			companyInforBean=companyInforService.queryCompanyInforBean(getId());
		} 
		return super.index();
	}

	public void setCompanyInforService(CompanyInforService companyInforService) {
		this.companyInforService = companyInforService;
	}
	
	public CompanyInforBean getCompanyInforBean() {
		return companyInforBean;
	}

	public void setCompanyInforBean(CompanyInforBean companyInforBean) {
		this.companyInforBean = companyInforBean;
	}

	public List<CompanyInforBean> getCompanyInforBeans() {
		return companyInforBeans;
	}

	public void setCompanyInforBeans(List<CompanyInforBean> companyInforBeans) {
		this.companyInforBeans = companyInforBeans;
	}

	

}
